# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Giorgio Lando <patroclo7@gmail.com>
# Contributor: bender02 at gmx dot com

pkgname=dvtm
pkgver=0.15
pkgrel=5
pkgdesc='Dynamic virtual terminal manager.'
arch=('loong64' 'x86_64')
url='http://www.brain-dump.org/projects/dvtm/'
license=('MIT')
depends=('ncurses')
source=("http://www.brain-dump.org/projects/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'config.h')
md5sums=('887e162a3abe2ad8e86caefab20cdd63'
         '243bc2d4085c08d9b748f892f5950a00')

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	cp "${srcdir}/config.h" .
	sed -i 's/CFLAGS =/CFLAGS +=/' config.mk
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	make clean
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	make PREFIX=/usr DESTDIR="${pkgdir}" install
	install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

	# this is provided by ncurses now
	rm -rf "${pkgdir}/usr/share/terminfo/"
}
